package day10Stringdemo;

import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串");
        String str = sc.next();
        String newStr = reverser(str);
        System.out.println(newStr);
    }
    public static String reverser(String str){
        String result = "";
        //字符串长度
        for (int i = str.length()-1; i >= 0; i--) {
            result = result + str.charAt(i);
        }
        return result;
    }
}
